﻿using System;
using Assisticant.Fields;

namespace UGD.Models
{
    public class Duty
    {
        private Observable<DateTime> _start = new Observable<DateTime>();
        private Observable<DateTime> _end = new Observable<DateTime>();

        public Duty()
        {
        }

        public Duty(DateTime start, DateTime end)
        {
            Start = start;
            End = end;
        }

        public Duty(DateTime start, double hourstoadd)
        {
            Start = start;
            End = start.AddHours(hourstoadd);
        }



        public DateTime Start
        {
            get
            {
                return _start.Value;
            }
            set
            {
                _start.Value = value;
            }
        }
        public DateTime End
        {
            get
            {
                return _end.Value;
            }
            set
            {
                _end.Value = value;
            }
        }

        public long Ticks => (_end.Value - _start.Value).Ticks;
    }
}
